package learn.Thread;

import java.util.concurrent.atomic.LongAdder;

public final class Singleton {
    private Singleton(){
    }
    private static volatile Singleton INSTANCE = null;

    public static Singleton getInstance(){
        if(INSTANCE!=null){
            return INSTANCE;
        }
        synchronized (Singleton.class){
            if(INSTANCE!=null){
                return INSTANCE;
            }
            INSTANCE = new Singleton();
            return INSTANCE;

        }
    }
}
